﻿using System;
using System.Data;
using System.Data.Common;
using PluginHandler;
namespace DatabaseManager.Util.Executers
{
    /// <summary>
    /// Interface which defines the structure of a class, which can execute data an return in a DataTable
    /// </summary>
    public interface IExecuter
    {
        /// <summary>
        /// Gets the data table, which contains the results of the executed query.
        /// </summary>
        /// <value>The data table.</value>
        DataTable DataTable { get; }

        /// <summary>
        /// Gets the <class cref="DbException"/>, if there has something been going wrong.
        /// </summary>
        /// <value>The database error.</value>
        DbException DbError { get; }

        /// <summary>
        /// Executes the query an saves the results in the given database object.
        /// </summary>
        /// <returns>True if the query could be executed whitout any errors</returns>
        bool ExecuteQuery();
    }
}
